import cgi
import os
import atom
import gdata.contacts
import gdata.contacts.service
import gdata.alt.appengine
from google.appengine.ext.webapp import template
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app



class MainPage(webapp.RequestHandler):
  def get(self): 
    #path=os.path.join(os.path.dirname(__file__) + '\\static\\' , 'login.htm')
    #self.response.out.write(template.render(path, None))

    gd_client = gdata.contacts.service.ContactsService()
    gd_client.email = 'fake@gmail.com'
    gd_client.password = 'password'
    gd_client.source = 'exampleCo-exampleApp-1'
    gd_client.ProgrammaticLogin()
    
     
	   

class Login(webapp.RequestHandler):
  def post(self):
    self.response.out.write(self.request.get('txtUsername'))
    
    


application = webapp.WSGIApplication(
                                     [('/', MainPage),
                                      ('/login', Login),],
                                     debug=True)

def main():
  run_wsgi_app(application)

if __name__ == "__main__":
  main()